export enum PriceType {
  LIMIT = "限价",
  LAST = "最新价",
  QUEUE = "排队价",
  COUNTER = "对手价",
  PREMIUM1 = "超价1T",
  PREMIUM2 = "超价2T",
  PREMIUM3 = "超价3T",
  PREMIUM5 = "超价5T"
}

export enum Direction {
  LONG = "多",
  SHORT = "空"
}

export enum Offset {
  OPEN = "开",
  CLOSE = "平"
}

export type TradeEnabledAppInfo = {
  trade_app_name: string;
  gateway_name: string;
  account_name: string;
  app_type?: string;
  trade_enabled?: boolean;
};

/** Manual preflight check request schema */
export type ManualPreflightCheckRequest = {
  symbol: string;
  exchange: string;
  invalidate_token: string;
  trade_app_name: string;
  session_id: string;
};

/** Manual preflight check response schema */
export type ManualPreflightCheckResponse = {
  is_valid: boolean;
  token?: string | null;
  trade_app_name?: string;
};

/** Manual place order request schema */
export type ManualOrderRequest = {
  symbol: string;
  exchange: string;
  direction: Direction; // 多/空
  offset: Offset; // 开/平
  price: number; // 限价时为价格，否则为0
  price_type: PriceType; // 价格类型
  volume: number; // 下单手数
  token: string; // 预检一次性token
  trade_app_name: string; // 交易应用名
};
